<div id="content-header">
    <h1>List Roles</h1>
</div>
<div id="breadcrumb">
    <a href="<?php echo $this->Html->url('/admin/')?>" title="Go to Home" class="tip-bottom"><i class="icon-th-list"></i> Home</a>
    <a href="<?php echo $this->Html->url(array('plugin'=>'user','controller' => 'roles', 'action' => 'admin_index'));?>" class="current">List Roles</a>
</div>
<div class="container-fluid">
<div class="row-fluid">
</div>
<div class="row-fluid">
    <div class="span12">
        <?php
            echo $this->Form->create('Role', array('id' => 'paginate','class'=>'form-horizontal', 'action' => 'edit', 'url' => $this->request->here(false), 'type' => 'post',
                    'inputDefaults' => array('label' => false, 'format' => array('before', 'label', 'between', 'input', 'after', 'error'))));
            echo $this->element('toolbar');
        ?>									
        <div class="widget-box">
            <?php 
                $fieldsets['name'] = $this->Form->input('name', array(
                        'label' => array('class' => 'control-label'),
                        'between' => '<div class="controls">',
                        'div' => array('class' => 'control-group'),
                        'after' => '</div>',
                        'type' => 'text'));

                $fieldsets['description'] = $this->Form->input('description', array(
                        'label' => array('class' => 'control-label'),
                        'between' => '<div class="controls">',
                        'div' => array('class' => 'control-group'),
                        'after' => '</div>',
                        'type' => 'text'));
                $fieldsets['subsite'] = $this->Form->input('subsite', array(
                        'label' => array('text'=>'Subsite','class' => 'control-label'),
                        'between' => '<div class="controls">',        
                        'div' => array('class' => 'control-group'),
                        'after' => '</div>',
                        'options'=>$listSubSite,
                        'type' => 'select'));                  
            ?>                
            <?php
                echo $this->Layout->form($_layouts, $fieldsets);
            ?>
        </div>
        <div class="list-chk-node-type">        
            <span class="span-choose-node"><?php echo __d('system','Choose Node Type');?></span>
            <div id="wrap-chk-node-type">                
                <?php if(!empty($rolesNodeType)):?>
                    <?php foreach($rolesNodeType as $key=>$values):?>
                        <div class="checkbox">        
                            <div class="chk-node-type">
                                <span><input type="checkbox" name="data[Role][NodeType][]" value="<?php echo $values['NodeType']['id'];?>"></span>
                            </div>
                            <label for="RoleNodeType<?php echo $values['NodeType']['id'];?>"><?php echo $values['NodeType']['name'];?></label>
                        </div>
                        <?php endforeach;?>
                <?php endif;?>
            </div>
        </div>	
        <?php
            echo $this->Form->hidden('Paginate.task', array('id' => 'task', 'value' => ''));
            echo $this->Form->end();
        ?>        								
    </div>	
</div>
